From 8a5e6cae09bcdcf33c8d8149f11cd8ab96973429 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 13 Sep 2004 17:34:54 +0000 Subject: [PATCH] Resize the popup if the model is replaced. (#152333) 2004-09-13 Matthias Clasen * gtk/gtkentrycompletion.c (gtk_entry_completion_get_model): Resize the popup if the model is replaced. (#152333) --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ gtk/gtkentrycompletion.c | 16 ++++++++++++++++ 5 files changed, 36 insertions(+) diff --git a/ChangeLog b/ChangeLog index ce4dca596b..2f4008c876 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-09-13 Matthias Clasen + + * gtk/gtkentrycompletion.c (gtk_entry_completion_get_model): Resize the + popup if the model is replaced. (#152333) + Mon Sep 13 09:11:53 2004 Manish Singh * gtk/gtkrange.c: fix gtk_range_real_change_value args. Addresses part diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index ce4dca596b..2f4008c876 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2004-09-13 Matthias Clasen + + * gtk/gtkentrycompletion.c (gtk_entry_completion_get_model): Resize the + popup if the model is replaced. (#152333) + Mon Sep 13 09:11:53 2004 Manish Singh * gtk/gtkrange.c: fix gtk_range_real_change_value args. Addresses part diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index ce4dca596b..2f4008c876 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +2004-09-13 Matthias Clasen + + * gtk/gtkentrycompletion.c (gtk_entry_completion_get_model): Resize the + popup if the model is replaced. (#152333) + Mon Sep 13 09:11:53 2004 Manish Singh * gtk/gtkrange.c: fix gtk_range_real_change_value args. Addresses part diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index ce4dca596b..2f4008c876 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2004-09-13 Matthias Clasen + + * gtk/gtkentrycompletion.c (gtk_entry_completion_get_model): Resize the + popup if the model is replaced. (#152333) + Mon Sep 13 09:11:53 2004 Manish Singh * gtk/gtkrange.c: fix gtk_range_real_change_value args. Addresses part diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c index f541134004..eb7288e239 100644 --- a/gtk/gtkentrycompletion.c +++ b/gtk/gtkentrycompletion.c @@ -905,6 +905,18 @@ gtk_entry_completion_get_entry (GtkEntryCompletion *completion) return completion->priv->entry; } +static void +filter_model_changed_cb (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer user_data) +{ + GtkEntryCompletion *completion = GTK_ENTRY_COMPLETION (user_data); + + if (GTK_WIDGET_VISIBLE (completion->priv->popup_window)) + _gtk_entry_completion_resize_popup (completion); +} + /** * gtk_entry_completion_set_model: * @completion: A #GtkEntryCompletion. @@ -930,9 +942,13 @@ gtk_entry_completion_set_model (GtkEntryCompletion *completion, gtk_entry_completion_visible_func, completion, NULL); + gtk_tree_view_set_model (GTK_TREE_VIEW (completion->priv->tree_view), GTK_TREE_MODEL (completion->priv->filter_model)); g_object_unref (G_OBJECT (completion->priv->filter_model)); + + if (GTK_WIDGET_VISIBLE (completion->priv->popup_window)) + _gtk_entry_completion_resize_popup (completion); } /** -- 2.30.2